import React, { Component,Suspense } from 'react'
import {Switch,Route,Redirect} from 'react-router-dom'
import router from './router'
import Loading from './components/Loading'

export default class App extends Component {
	render() {
		return (
			<div>
				<Suspense fallback={<Loading/>}>
					<Switch>
						{router.map( r => <Route key={r.path} {...r}/>)}
						<Redirect to="/login"/>
					</Switch>
				</Suspense>
			</div>
		)
	}
}
